/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package util;

import java.io.UnsupportedEncodingException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Administrator
 */
public class StringUtils {

    public static String ans2GB(String src){
        String target = null;
        try {
            if(src != null && src.trim().length() > 0){
                target = new String(src.getBytes("ISO-8859-1"), "GB18030");
            }
        } catch (UnsupportedEncodingException ex) {
            Logger.getLogger(StringUtils.class.getName()).log(Level.SEVERE, null, ex);
        }
        return target;
    }
}
